import React, { memo,useRef } from 'react'

const App = memo(() => {
  const titleRef = useRef();
  function showTitle(){
    console.log(titleRef.current.innerHTML);
  }
  return (
    <div>
      <h2 ref={titleRef} className="title">App</h2>
      <button onClick={e=>showTitle()}>查看title dom</button>
    </div>
  )
})

export default App